The present invention relates generally to computer networks, and more particularly in notification services for such computer networks.
Sometimes, users of a computer network wishes to receive certain types of information from their network. For example, a stockbroker may wish to be notified of the price of a particular stock when the price changes. One way for the network to provide this type of service is to use the Notification Service of COMPONENT BROKER, a Common Object Request Broker Architecture (CORBA)-based service developed by INTERNATIONAL BUSINESS MACHINES CORPORATION, which is an extension of Object Management Group (OMG) services. CORBA is a standard for distributed objects in a computer network and provides the mechanisms by which objects transparently make requests and receive responses. The OMG is a consortium of software vendors and end users. Many OMG member companies are developing commercial products that support these standards and/or are developing software that use this standard. Component Broker and CORBA are well known in the art and will not be discussed in detail here.
FIG. 1 illustrates a conventional computer network which may offer the Notification Service of Component Broker. The computer network 100 comprises a server 102 and a plurality of workstations 104. The server 102 contains the Component Broker software 106. Software applications 108, residing on the server 102 and/or the workstations 104, operate with the Component Broker 106. A user at a workstation 104 may inform the Component Broker 106 that he/she wishes to be notified when a certain event occurs, such as the change in price stock. The Component Broker 106 monitors events from the application 108. When an event occurs which matches the user""s wish, the Component Broker 106 sends a message to the user with information concerning the event.
However, users typically do not wish to be inundated with all available information concerning a topic. For example, the stock broker may wish only to be notified when a particular company""s stock price changes to below $100 per share and does not wish to be notified otherwise. The Component Broker 106 accommodates the user by allowing him/her to enter constraints in their requests for notification, using a constraint language. The constraints entered by the user is referred to as the xe2x80x9cconstraint stringxe2x80x9d. For example, the stock broker may enter the following constraint string:
($company==xe2x80x98IBMxe2x80x99) AND ($stockprice less than 100.00).
xe2x80x9c$companyxe2x80x9d and xe2x80x9c$stockpricexe2x80x9d are variables, with xe2x80x9c$companyxe2x80x9d referring to the name of the stock, and xe2x80x9c$stockpricexe2x80x9d referring to the stock""s current price. xe2x80x9c==xe2x80x9d, xe2x80x9cANDxe2x80x9d, and xe2x80x9c less than xe2x80x9d are operators. xe2x80x9cIBMxe2x80x9d is a character string which is surrounded by single quotes. The user""s constraint string thus informs the Component Broker 106 that the user wishes to be notified of all events concerning IBM stock below a current price of $100. The constraint language of the Component Broker 106 is well known in the art and will not be discussed in further detail here.
When the user inputs a constraint string, the Component Broker 106 checks for syntax errors. Examples of errors include:
mismatched grouping operators: $a*($b+$c))
invalid mathematical operator: $a++1
invalid comparative functions: $a=1
unsupported Boolean connectives: ($a greater than 1) xnor ($b greater than 1)
xe2x80x9c$xe2x80x9d is missing for a variable: a greater than 1
The conventional method of checking the constraint string for errors performs the checking when the Component Broker 106 first receives the constraint string from the user. If an error is found, then the constraint string is rejected immediately. If no errors are found, the Component Broker 106 accepts it as a valid constraint string and proceeds to process the notification request by monitoring events from the application 108. However, the error checking occurs on a case by case basis, i.e., the Component Broker 106 checks for known and predictable types of errors. Unfortunately, a constraint string could be invalid in an infinitive number of ways. To detect every possible error in the constraint string is almost an impossible task since it is almost impossible to anticipate or predict all of the possible errors a user may make. Thus, errors are not always detected. If a constraint string with an error is not detected, the Component Broker accepts the constraint string as a valid constraint string, and the error is not detected until the Component broker 106 attempts to process the constraint string during run time. Only when the Component Broker 106 attempts to match an event with the constraint string, and cannot due to the error, will the Component Broker 106 detect the error. By the time the error is detected, a significant time period could have already passed from the time the constraint string was entered by the user. This time period could be hours, days, weeks, or even months. This wastes valuable time, and the requesting user will fail to receive the requested notifications.
Accordingly, what is needed is a system and method for providing a parser for a constraint language in a computer network. The parser should detect all invalid constraints and should be easy to implement. The present invention addresses such a need.
The present invention provides a system and method for parsing a constraint language in a computer network. The method includes receiving a constraint string; parsing the constraint string, comprising replacement of valid operators, variables, and values with special characters; and determining if the parsed constraint string indicates the existence of errors in the constraint string. The parser of the present invention is based upon an analysis of the constraint language from which patterns of the language are identified. The easily implemented parser of the present invention is developed based on these patterns. Because the method of the present invention replaces members of a finite set of valid operators, variables, and values, instead of attempting to identify an infinite number of possible errors, it is able to detect all invalid constraints.